package design_pattern;

/**
 * @ClassName TestSingleton
 * @Deacription TODO
 * @Author 谢忠辉
 * @Date 2021/3/17 0017 20:21
 **/
public class TestSingleton {
    public static void main( String []args){
        Singleton []singletons = new Singleton[5] ;
        for (int i = 0; i < singletons.length; i++) {
            singletons[i] = Singleton.getInstance();
            singletons[i].setName(i);

        }
        for (int i = 0; i < singletons.length; i++) {
            System.out.println(singletons[i]);
            singletons[i].printInfo();
        }
    }

}
